from LogisticsCard.view.menu_views import menu_list_view, menu_create_view, menu_edit_view, menu_delete_view, menu_update_permission_view, menu_update_status_view, menu_update_order_view
from LogisticsCard.view.package_views import package_list_view, package_create_view, package_edit_view, package_delete_view
"""
URL configuration for LogisticsCard project.

The `urlpatterns` list routes URLs to  For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from LogisticsCard.view.login_views import login_view, logout_view
from LogisticsCard.view.user_views import change_password_view, users_view, add_user_view, edit_user_view, delete_user_view
from LogisticsCard.view.normal_user_views import normal_users_view, delete_normal_user_view, edit_normal_user_view
from LogisticsCard.view.card_views import assign_card_view, delete_card_view, cards_view, add_card_view, edit_card_view, import_cards_view, export_cards_view, cards_update_view
from LogisticsCard.view.permission_views import permissions_view, add_permission_view, edit_permission_view, delete_permission_view
from LogisticsCard.view.system_config_views import system_config_view
from LogisticsCard.view.task_views import tasks_view, add_task_view, edit_task_view, delete_task_view
from LogisticsCard.view.index_views import index_view
from LogisticsCard.view.role_views import roles_view, add_role_view, edit_role_view, delete_role_view
from LogisticsCard.view.log_views import logs_view
from LogisticsCard.view.address_views import address_list_view, address_create_view, address_delete_view
from LogisticsCard.view.customer_views import customer_list_view, customer_create_view,customer_edit_view,customer_generate_user_view, price_config_list_view, price_config_create_view
from LogisticsCard.view.price_config_views import price_config_edit_view, price_config_delete_view
from LogisticsCard.view.fee_views import fee_detail_list_view
from django.urls import path
from LogisticsCard.view.flowpool_views import user_flowpool_list_view, flowpool_detail_view
from LogisticsCard.view.order_views import order_list_view, order_cards_view,order_cards_export_view,order_detail_view, order_create_view, order_pay_view,order_edit_view, order_cancel_view,order_paid_view, order_deliver_view, order_pay_success_view
from LogisticsCard.view.pool_views import pool_list_view, pool_detail_view, deactivation_list_view
from LogisticsCard.view.warning_views import flow_warning_list_view, flow_warning_record_list_view, card_expire_reminder_list_view
from LogisticsCard.view.card_api_views import card_search_api
from LogisticsCard.view.order_api_views import query_pay_status_api
from LogisticsCard.view.system_config_manage_views import (
    system_config_list_view, system_config_create_view,
    system_config_edit_view, system_config_delete_view
)
from LogisticsCard.view.wechatpay_views import wechatpay_notify
from LogisticsCard.view.renew_order_views import renew_select_customer_view, renew_select_cards_view, renew_confirm_view, renew_submit_view

urlpatterns = [
    path('cards/import/', import_cards_view, name='import_cards'),
    path('cards/export/', export_cards_view, name='export_cards'),
    path('cards/update/', cards_update_view, name='cards_update'),
    #菜单管理
    path('menu/', menu_list_view, name='menu_list'),
    path('menu/create/', menu_create_view, name='menu_create'),
    path('menu/edit/<int:menu_id>/', menu_edit_view, name='menu_edit'),
    path('menu/delete/<int:menu_id>/', menu_delete_view, name='menu_delete'),
    path('menu/update_permission/<int:menu_id>/', menu_update_permission_view, name='menu_update_permission'),
    path('menu/update_status/<int:menu_id>/', menu_update_status_view, name='menu_update_status'),
    path('menu/update_order/', menu_update_order_view, name='menu_update_order'),
    #套餐管理
    path('package/', package_list_view, name='package_list'),
    path('package/create/', package_create_view, name='package_create'),
    path('package/edit/<int:package_id>/', package_edit_view, name='package_edit'),
    path('package/delete/<int:package_id>/', package_delete_view, name='package_delete'),
    
    #path('admin/', admin.site.urls),
    #首页
    path('normal_users/', normal_users_view, name='normal_users'),
    path('delete_normal_user/<int:user_id>/', delete_normal_user_view, name='delete_normal_user'),
    path('normal_user/edit/<int:user_id>/', edit_normal_user_view, name='edit_normal_user'),
    path('', index_view, name='index'),
    #登录登出
    path('login/', login_view, name='login'),
    path('logout/', logout_view, name='logout'),
    path('change_password/', change_password_view, name='change_password'),
    #用户管理
    path('users/', users_view, name='users'),
    path('add_user/', add_user_view, name='add_user'),
    path('edit_user/<int:user_id>/', edit_user_view, name='edit_user'),
    path('delete_user/<int:user_id>/', delete_user_view, name='delete_user'),
    #角色管理
    path('roles/', roles_view, name='roles'),
    path('add_role/', add_role_view, name='add_role'),
    path('edit_role/<int:role_id>/', edit_role_view, name='edit_role'),
    path('delete_role/<int:role_id>/', delete_role_view, name='delete_role'),
    #权限管理
    path('permissions/', permissions_view, name='permissions'),
    path('add_permission/', add_permission_view, name='add_permission'),
    path('edit_permission/<int:perm_id>/', edit_permission_view, name='edit_permission'),
    path('delete_permission/<int:perm_id>/', delete_permission_view, name='delete_permission'),
    #卡管理
    path('cards/', cards_view, name='cards'),
    path('add_card/', add_card_view, name='add_card'),
    path('edit_card/<int:card_id>/', edit_card_view, name='edit_card'),
    path('assign_card/<int:card_id>/', assign_card_view, name='assign_card'),
    path('delete_card/<int:card_id>/', delete_card_view, name='delete_card'),
    #任务管理
    path('tasks/', tasks_view, name='tasks'),
    path('add_task/', add_task_view, name='add_task'),
    path('edit_task/<int:task_id>/', edit_task_view, name='edit_task'),
    path('delete_task/<int:task_id>/', delete_task_view, name='delete_task'),
    #系统配置
    path('system_config/', system_config_view, name='system_config'),
    #日志管理
    path('logs/', logs_view, name='logs'),
    #地址管理

    path('address/', address_list_view, name='address_list'),
    path('address/create/', address_create_view, name='address_create'),
    path('address/delete/<int:address_id>/', address_delete_view, name='address_delete'),
    #客户管理
    path('customer/', customer_list_view, name='customer_list'),
    path('customer/create/', customer_create_view, name='customer_create'),
    path('customer/<int:customer_id>/price_config/', price_config_list_view, name='price_config_list'),
    path('customer/<int:customer_id>/price_config/create/', price_config_create_view, name='price_config_create'),
    path('customer/<int:customer_id>/price_config/<int:config_id>/edit/', price_config_edit_view, name='price_config_edit'),
    path('customer/<int:customer_id>/price_config/<int:config_id>/delete/', price_config_delete_view, name='price_config_delete'),
    path('customer/edit/<int:customer_id>/', customer_edit_view, name='customer_edit'),
    #费用管理
    path('fee/', fee_detail_list_view, name='fee_detail_list'),
    #流池管理
    path('flowpool/', user_flowpool_list_view, name='user_flowpool_list'),
    path('flowpool/<int:pool_id>/', flowpool_detail_view, name='flowpool_detail'),
    #订单管理
    path('orders/', order_list_view, name='order_list'),
    path('orders/<int:order_id>/', order_detail_view, name='order_detail'),
    path('orders/create/', order_create_view, name='order_create'),
    path('orders/edit/<int:order_id>/', order_edit_view, name='order_edit'),
    path('order/pay/<int:order_id>/', order_pay_view, name='order_pay'),
    path('order/pay/success/<int:order_id>/', order_pay_success_view, name='order_pay_success'),
    path('order/cancel/<int:order_id>/', order_cancel_view, name='order_cancel'),
    path('orders/paid/<int:order_id>/', order_paid_view, name='order_paid'),
    path('orders/deliver/<int:order_id>/', order_deliver_view, name='order_deliver'),
    path('orders/cards/<int:order_id>/', order_cards_view, name='order_cards'),
    path('orders/cards/export/<int:order_id>/', order_cards_export_view, name='order_cards_export'),
    #
    path('pool/', pool_list_view, name='pool_list'),
    path('pool/<int:pool_id>/', pool_detail_view, name='pool_detail'),
    path('pool/deactivation/', deactivation_list_view, name='deactivation_list'),
    #警告管理
    path('warning/flow/', flow_warning_list_view, name='flow_warning_list'),
    path('warning/flow_record/', flow_warning_record_list_view, name='flow_warning_record_list'),
    path('warning/expire/', card_expire_reminder_list_view, name='card_expire_reminder_list'),
    # 卡号自动补全API
    path('api/card_search/', card_search_api, name='card_search_api'),
    path('api/order/query_pay/', query_pay_status_api, name='query_pay_status_api'),
    # 系统配置管理
    path('system_config_manage/', system_config_list_view, name='system_config_manage'),
    path('system_config_manage/create/', system_config_create_view, name='system_config_create'),
    path('system_config_manage/edit/<int:config_id>/', system_config_edit_view, name='system_config_edit'),
    path('system_config_manage/delete/<int:config_id>/', system_config_delete_view, name='system_config_delete'),
    path('customer/generate_user/<int:customer_id>/', customer_generate_user_view, name='customer_generate_user'),
    path('wechatpay/notify/', wechatpay_notify, name='wechatpay_notify'),
    path('orders/renew/select_customer/', renew_select_customer_view, name='renew_select_customer'),
    path('orders/renew/select/', renew_select_cards_view, name='renew_select_cards'),
    path('orders/renew/confirm/', renew_confirm_view, name='renew_confirm'),
    path('orders/renew/submit/', renew_submit_view, name='renew_submit'),

]
